package com.coderman.youpinshop.stock.mapper;

import com.coderman.youpinshop.stock.dataobject.StockDO;
import org.apache.ibatis.annotations.Param;

/**
 * Description:
 * date: 2022/1/15
 *
 * @author shenshuai
 * @version 1.0.0
 * @since JDK 1.8
 */
public interface StockMapper {
    /**
     * 扣减库存
     * @param stockCode
     * @param deductCount
     * @return
     */
    int deduct(@Param(value = "stockCode") String stockCode,@Param(value = "deductCount") Integer deductCount);

    /**
     * 更新库存
     * @param stockCode
     * @param quantity
     * @return
     */
    int updateQuantity(@Param(value = "stockCode") String stockCode,@Param(value = "quantity") Integer quantity);



    /**
     * 根据库存编码获取库存信息
     * @param stockCode
     * @return
     */
    StockDO getByStockCode(@Param(value = "stockCode") String stockCode);


}
